package com.jx.gocomtask.webservice.repository.impl;

/**
 * 字符串转义工具类
 * Created by DEMON on 2017/5/3.
 */
public class StringEscapeUtils {

    /**
     * 防sql注入
     * @param str
     * @return
     */
    public static String escapeSql(String str) {
        if (str == null) {
            return null;
        }
        return str.replace("'", "''").replace(";","").replace("#","").replace("--","");
    }
}
